<?php

/*
 * CLASE ENTIDAD CARGO 
 * Autor: Luis Rojas
 * Version: 1.0
 * Fecha Creacion: 26/08/2013
 * Fecha Modificación: 26/08/2013
 */
require_once '../Control/CsCtrlData.php';
require_once '../Data/CsConexion.php';
class CsCargo extends CsConexion {
    var $tabla;
    var $atributo;
    var $ncol;
    var $nllave;
    
    function  CsCargo(){
        $this->tabla = "cargo";
        $this->atributo[0]="carcod";
        $this->atributo[1]="carnom";
        $this->ncol=2;
        $this->nllave=1;
    }
    
    function GuardarDato($cn){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Insert($this->tabla, $this->dato, $this->ncol);
        return $this->Transaccionx($sql,$cn);
    }
    
    function ActualizarDato($cn){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Update($this->tabla, $this->dato, $this->atributo, $this->ncol, $this->nllave);
        return $this->Transaccionx($sql, $cn);
    }
    
    function EliminarDato($cn){
        $objcontrol = new CsCtrlData();
        $sql = $objcontrol->Delete($this->tabla, $this->dato, $this->atributo, $this->nllave);
        return $this->Transaccionx($sql, $cn);
    }
    
    function TraerDatos(){
        $sql = "select * from $this->tabla";
        return $this->Transaccion($sql);
    }
}

?>
